{extend name="main"}
{block name="style"}
<style type="text/css">
.w-60px{width: 60px;}
.text-eda5de{color: #eda5de}
</style>
{/block}
{block name="header"}
{include file="module/top_nav" container="container-xl"/}
{include file="module/header_concise"/}
{/block}
{block name="body"}
<div class="container-xl py-3">
	<div class="flex">
		<div class="flex-1">
			<div class="bg-white shadow">
				<div class="flex border-bottom p-4">
					<div>
						<img src="{$Find.headimg}" width="80" height="80" class="rounded-circle">
					</div>
					<div class="flex-1 px-4 pt-3">
						<div class="flex flex-center">
							<h5 class="font-weight-bold">{$Find.name}{switch Find.sex}{case 1}<i class="el-icon-male text-primary ml-1"></i>{/case}{case 2}<i class="el-icon-female text-eda5de ml-1"></i>{/case}{default /}{/switch}</h5>
							<el-button type="success" round size="minism" class="ml-3 d-print-none" icon="el-icon-chat-dot-round" @click="IMvm.applyToUserContacts(getImContactsUserData());">立即沟通</el-button>
						</div>
						<div class="pt-2">{$Find.age}岁 丨 {$Find.educational_background} 丨 {$Find.work_experience_time}年工作经验</div>
						<div class="pt-2">{notempty name="Find.residence"}现居住：{$Find.residence}{/notempty}{notempty name="Find.native_place"} 丨 户籍：{$Find.native_place}{/notempty}</div>
						{notempty name="Find.specialty_label"}
						<div class="pt-2">
							{volist name="Find.specialty_label" id="v"}
							<el-tag type="primary" size="mini">{$v}</el-tag>
				    		{/volist}
						</div>
						{/notempty}
						<div class="flex pt-2">
							<div>{$Find.job_status}</div>
						</div>
					</div>
					<div class="pt-3">
						<div class="text-secondary">更新时间：{$Find.refresh_time}</div>
						<div class="pt-5 d-print-none">
							<el-button type="success" class="rounded-0"
							@click="getContactsData()">获取联系方式</el-button>
						</div>
						<div class="pt-5 d-none d-print-block" v-if="Contacts">
							联系电话：{{Contacts.mobile}}
						</div>
					</div>
				</div>
				{notempty name="Find.resume_employment_intention"}
				<div class="p-4">
					<div class="flex mb-3">
						<div class="flex-1 block-title-before pb-2">求职意向</div>
					</div>
					{volist name="Find.resume_employment_intention" id="v"}
					<div class="flex py-2">
						<div class="flex flex-center">
							<div>
								<i class="el-icon-location-outline"></i>{notempty name="v.area_city"}
								<span>{$v.area_city}-{$v.area_area}</span>
								{else/}
								<span>地区不限</span>
								{/notempty}
							</div>
							<div class="border-left py-1 mx-2"></div>
							<div>
								{$v.jobs_cate3}
							</div>
							{neq name="v.nature_of_work" value="1"}
							<div class="px-1">·</div>
							<div>{eq name="v.nature_of_work" value="2"}兼职{else/}实习{/eq}</div>
							{/neq}
							<div class="border-left py-1 mx-2"></div>
							<div>
								{empty name="v.industry"}
								<span>行业不限</span>
								{else/}
								<span>{$v.industry}</span>
								{/empty}
							</div>
							<div class="border-left py-1 mx-2"></div>
							<div>
								期望薪资：
								{gt name="v.salary_min" value="0"}{$v.salary_min}~{$v.salary_max}K/月{else/}面议{/gt}
							</div>
					    </div>
					</div>
					{/volist}
				</div>
				{/notempty}
				{notempty name="Find.self_description"}
				<div class="p-4">
					<div class="flex mb-3">
						<div class="flex-1 block-title-before pb-2">自我描述</div>
					</div>
					<div class="text-secondary">{$Find.self_description}</div>
				</div>
				{/notempty}
				{notempty name="Find.educational_experience"}
				<div class="p-4">
					<div class="flex mb-3">
						<div class="flex-1 block-title-before pb-2">教育经历</div>
					</div>
					<el-timeline class="pt-3">
						{volist name="Find.educational_experience" id="v"}
					    <el-timeline-item>
					    	<div>{$v.educational_background} 丨 {$v.school_name} 丨 {$v.specialities}</div>
					    	<div class="text-secondary">{$v.start_time}至{$v.end_time}</div>
					    </el-timeline-item>
					    {/volist}
					</el-timeline>
				</div>
				{/notempty}
				{notempty name="Find.work_experience"}
				<div class="p-4">
					<div class="flex mb-3">
						<div class="block-title-before pb-2">工作经历</div>
						<div class="text-primary pl-3">(TA参加工作了{$Find.work_experience_time}年，共做了{$Find.work_experience|count}份工作)</div>
					</div>
					{volist name="Find.work_experience" id="v"}
					<div class="flex pt-4 hover-show-block">
						<div class="pr-2 text-secondary">
							<i class="el-icon-office-building"></i>
						</div>
						<div class="flex-1">
							<div class="flex flex-center">
								<div>{$v.company_name} 丨 {$v.job_title}</div>
								<div class="text-secondary pl-3">{$v.start_time}-{$v.end_time}</div>
							</div>
							<div class="text-secondary pt-3 pr-5">{$v.job_content}</div>
						</div>
					</div>
				    {/volist}
				</div>
				{/notempty}
				{notempty name="Find.training_experience"}
				<div class="p-4">
					<div class="flex mb-3">
						<div class="block-title-before pb-2">培训经历</div>
					</div>
					{volist name="Find.training_experience" id="v"}
					<div class="flex pt-4">
						<div class="pr-2 text-secondary">
							<i class="el-icon-reading"></i>
						</div>
						<div class="flex-1">
							<div class="flex flex-center">
								<div>{$v.project_name} 丨 {$v.mechanism}</div>
								<div class="text-secondary pl-3">{$v.start_time}-{$v.end_time}</div>
							</div>
							<div class="text-secondary pt-3 pr-5">{$v.training_content}</div>
						</div>
					</div>
				    {/volist}
				</div>
				{/notempty}
				{notempty name="Find.project_experience"}
				<div class="p-4">
					<div class="flex mb-3">
						<div class="block-title-before pb-2">项目经历</div>
					</div>
					{volist name="Find.project_experience" id="v"}
					<div class="flex pt-4 hover-show-block">
						<div class="pr-2 text-secondary">
							<i class="el-icon-suitcase"></i>
						</div>
						<div class="flex-1">
							<div class="flex flex-center">
								<div>{$v.project_name} 丨 {$v.project_role}</div>
								<div class="text-secondary pl-3">{$v.start_time}-{$v.end_time}</div>
							</div>
							<div class="text-secondary pt-3 pr-5">{$v.project_content}</div>
							<div class="text-secondary pt-3 pr-5">{$v.project_link}</div>
						</div>
					</div>
				    {/volist}
				</div>
				{/notempty}
				{notempty name="Find.certificate"}
				<div class="p-4">
					<div class="flex mb-3">
						<div class="block-title-before pb-2">获得证书</div>
					</div>
					<div>
						{volist name="Find.certificate" id="v"}
						<el-tag type="primary" class="mb-2">{$v}</el-tag>
				    	{/volist}
					</div>
				</div>
				{/notempty}
				{notempty name="Find.language_ability"}
				<div class="p-4">
					<div class="flex mb-3">
						<div class="flex-1 block-title-before pb-2">语言能力</div>
					</div>
					<div>
						{volist name="Find.language_ability" id="v"}
						<el-tag type="primary" class="mb-2">{$v}</el-tag>
				    	{/volist}
					</div>
				</div>
				{/notempty}
				{notempty name="Find.works"}
				<div class="p-4">
					<div class="flex mb-3">
						<div class="flex-1 block-title-before pb-2">照片/作品</div>
					</div>
					<div class="row">
						<el-image
					      style="width: 180px;height: 160px;"
					      :src="v"
					      fit="cover"
					      :title="v.title"
					      :preview-src-list="Find.works"
					      v-for="(v,index) in Find.works"
					      class="col-auto"></el-image>
					</div>
				</div>
				{/notempty}
				<div class="p-2 small text-secondary text-right d-print-block d-none">
					<a href="/resume/{$Find.id}.html">{xycms:web name="url"}/resume/{$Find.id}.html</a>
				</div>
			</div>
		</div>
		<div class="w-300px ml-3 d-print-none">
			<div class="bg-white mb-3 shadow p-3">
				<el-divider class="bg-primary">操作</el-divider>
				<div class="row">
					<div class="col-6 pointer text-center py-3"
					@click="toggleResumeCollection(Find)">
						<img src="__TEMPLATE_STATIC__/icon/icon_collection.png" alt="" height="42">
						<div class="text-grey">{{Find.is_collection?'取消关注':'关注该简历'}}</div>
					</div>
					<div class="col-6 pointer text-center py-3"
					@click="window.print();">
						<img src="__TEMPLATE_STATIC__/icon/icon_print.png" alt="" height="42">
						<div class="text-grey">打印简历</div>
					</div>
					<div class="col-6 pointer text-center py-3" @click="feedback.data=Find;feedback.win=true;feedback.form.type=6;feedback.form.alias_id=Find.id;">
						<img src="__TEMPLATE_STATIC__/icon/icon_feedback.png" alt="" height="42">
						<div class="text-grey">投诉简历</div>
					</div>
				</div>
			</div>
			<div class="bg-white p-4 shadow" style="background-image: url(__TEMPLATE_STATIC__/down_resume_bg.png);background-size: 100% 100%;">
				<div class="text-center">
					<img src="/displayQrcode?scheme={xycms:web name='downUrl'}/resume/{$Find.id}&icon=1" width="120" height="120">
					<div class="text-small text-secondary mt-2">在{xycms:web name="name"}APP中查看</div>
				</div>
				<div class="pt-4">
					<el-button type="primary" class="d-block w-100 rounded-0"@click="downloadsResume(Find)" size="small">下载简历</el-button>
				</div>
			</div>
		</div>
	</div>
</div>
{/block}
{block name="footer"}
{include file="module/footer"/}
{include file="module/login"/}
{include file="module/buy_win"/}
{/block}
{block name="script"}
<script type="text/javascript">
	{empty name="Find"}
	var Find={works:[]};
	{else/}
	var Find={:json_encode($Find,JSON_UNESCAPED_UNICODE)};
	{/empty}
	{empty name=":request()->get('jobs_id')"}
	var jobs_id=0;
	{else/}
	var jobs_id={:request()->get('jobs_id')};
	{/empty}
</script>
<script type="text/javascript">
	var vm=new Vue({
		el:'#app',
		data:{
			view:XYBase.view,
			loginTabs:XYBase.loginTabs,
			feedback:XYBase.feedback,
			userInfo:UserInfo,
			confirm:0,
			Find:Find,
			jobs_id:jobs_id,
			buy:XYBase.buy,
			xy_score:{
				recharge_rate:{xycms:scoreconfig name="recharge_rate"},
				is_integer:{xycms:scoreconfig name="is_integer"},
				proportion:{xycms:scoreconfig name="proportion"},
			},
			Contacts:null
		},
		watch:{
		    view:XYBase.viewWatch,
		    loginTabs:XYBase.loginTabsWatch,
		},
		created(){
			XYBase.created(this);
			this.getContacts();
		},
		methods:XYBase.methods({
			openNewBuy(val){
	    		document.body.style="overflow: hidden;padding-right:17px;";
	    		this.buy.title='下载简历';
	    		this.buy.stitle='下载'+this.Find.name+'简历';
				this.buy.pay_status='download-resume';
	    		this.buy.form.pay_type='';
	    		this.buy.form.type=11;
	    		this.buy.form.alias_id=val.id;
	    		this.buy.price=val.price;
	    		this.buy.data=val;
	    		this.buy.data.title=this.buy.title;
	    		this.buy.view=true;
				this.getScoreOrderPrice();
			},
			orderPaySuccess(val) {
				if (!this.hasOwnProperty('buy'))
					return ;
				if (val.otrade===this.buy.orderInfo.otrade)
					this.buy.pay_status='success';
				if (this.buy.orderTimeEr)
					clearInterval(this.buy.orderTimeEr);
				this.downloadsResume(this.Find);
			},
			downloadsResume(row){
				var _this=this;
				const loading=XYBase.openloading();
				_this.sendPost({
					url:'/downloads/resume/'+row.id+'?confirm='+_this.confirm,
				},function(ret) {
		        	_this.confirm=0;
					loading.close();
					if (ret) {
						if (ret.code === 0) {
							if (ret.data.type=='download') {
								XYBase.success(ret.msg);
								window.open("{xycms:web name='url'}/downloads/resume/"+ret.data.id);
							}else if(ret.data.type=='pay'){
								_this.openNewBuy(ret.data);
							}
						}else if(ret.code === 200){
							_this.$confirm(ret.msg, '提示', {
								dangerouslyUseHTMLString:true,
					          	confirmButtonText: '确定',
					          	cancelButtonText: '取消',
					          	type: 'warning'
					        }).then(() => {
					        	_this.confirm=1;
					        	_this.downloadsResume(row);
					        }).catch(() => {
					        });
						}else{
							XYBase.msg(ret.msg);
						}
					}
				});
			},
			getImContactsUserData(){
				return {touid:Find.uid,nickname:Find.name,headimg:Find.headimg,jobs_id:0}
			},
			getContacts(){
				var _this=this;
				_this.sendGet({
					url:'/resume/getContactsData/'+_this.Find.id+'?jobs_id='+jobs_id,
				},function(ret) {
					if (ret) {
						if (ret.code === 0) {
							_this.Contacts=ret.data;
						}
					}
				});
			},
			getContactsData(){
				if(this.Contacts)
					return this.showContacts();
				var _this=this;
				const loading=XYBase.openloading();
				_this.sendGet({
					url:'/resume/getContactsData/'+_this.Find.id+'?jobs_id='+jobs_id,
				},function(ret) {
					loading.close();
					if (ret) {
						if (ret.code === 0) {
							_this.Contacts=ret.data;
							_this.showContacts();
						}else if(ret.code === -101){
							_this.$confirm(ret.msg, '提示', {
								dangerouslyUseHTMLString:true,
					          	confirmButtonText: '切换',
					          	cancelButtonText: '取消',
					          	type: 'warning'
					        }).then(() => {
					        	_this.goToCompany();
					        }).catch(() => {
					        });
						}else if(ret.code === -601){
							_this.$confirm(ret.msg, '提示', {
								dangerouslyUseHTMLString:true,
					          	confirmButtonText: '去完善',
					          	cancelButtonText: '取消',
					          	type: 'warning'
					        }).then(() => {
					        	window.open('/user/account');
					        }).catch(() => {
					        });
						}else if(ret.code === 200){
							_this.$confirm(ret.msg, '提示', {
								dangerouslyUseHTMLString:true,
					          	confirmButtonText: '下载',
					          	cancelButtonText: '取消',
					          	type: 'warning'
					        }).then(() => {
					        	_this.downloadsResume(_this.Find);
					        }).catch(() => {
					        });
						}else{
							XYBase.msg(ret.msg);
						}
					}
				});
			},
			showContacts(){
		        const h = this.$createElement;
		        this.$msgbox({
		          title: '消息',
		          message: h('div', null, [
		            h('div', {class:'flex flex-center py-1'}, [
			            h('div', {class:'pr-2 w-60px'}, '联系人 ',[
			            	]),
			            h('div', null, this.Contacts.name)
			        ]),
		            h('div', {class:'flex flex-center py-1'}, [
			            h('div', {class:'pr-2 w-60px'}, '电话 ',[
			            	]),
			            h('a', {href:"tel://"+this.Contacts.mobile}, this.Contacts.mobile)
			        ]),
		          ]),
		          showCancelButton: false,
		          confirmButtonText: '关闭'
		        }).then(action => {
		        }).catch(() => {});
			}
		})
	});
</script>
{/block}